﻿<UserControl x:Class="NthDownload.Views.QueuesView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:cal="http://www.caliburnproject.org"
             mc:Ignorable="d" 
             MinHeight="300" MinWidth="300">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>

        <StackPanel Orientation="Horizontal" Grid.Row="0" Margin="0,0,0,5" >
            <ItemsControl ItemsSource="{Binding Profile.Queues}">
                <ItemsControl.ItemTemplate>
                    <DataTemplate>
                        <StackPanel Orientation="Horizontal">
                            <Button Content="{Binding Name}" cal:Message.Attach="[Event Click] = [Action ShowQueue($dataContext)]" />
                            <Button Content="E" Style="{StaticResource ItemsControlStackPanelMouseOverButton}" 
                                    cal:Message.Attach="[Event Click] = [Action EditQueue($dataContext)]"/>
                            <Button Content="X" Style="{StaticResource ItemsControlStackPanelMouseOverButton}" Margin="0,0,3,0"
                                    cal:Message.Attach="[Event Click] = [Action RemoveQueue($dataContext)]"/>
                        </StackPanel>
                    </DataTemplate>
                </ItemsControl.ItemTemplate>
                <ItemsControl.ItemsPanel>
                    <ItemsPanelTemplate>
                        <StackPanel Orientation="Horizontal" />
                    </ItemsPanelTemplate>
                </ItemsControl.ItemsPanel>
            </ItemsControl>
            <Button x:Name="AddNewQueue" Content="  +  " />
        </StackPanel>

        <ContentControl x:Name="ActiveItem" Grid.Row="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
    </Grid>
</UserControl>
